<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>翻书效果</title>
    <style>
        .book {
            width: 300px;
            height: 400px;
            margin: 100px auto;
            position: relative;
            perspective: 1000px;
        }
        .page {
            width: inherit;
            height: inherit;
            transform-style: preserve-3d;
            transform-origin: left;
        }
        .first {
            background-color: orange;
        }
        .second {
            background-color: yellow;
            position: absolute;
            top:0;
            left:0;
            z-index: -1;
        }
        .page-item {
            width: inherit;
            height: inherit;
            position: relative;
        }
        .front {
            background-color: pink;
        }
        .back {
            background-color: purple;
            position: absolute;
            top:0;
            left:0;
            /* z-index: -1; */
            transform: translateZ(-1px) rotateY(-180deg);
        }
        .book:hover .page.first {
            transform: rotateY(-180deg);
            transition: transform 1s;
        }
        img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }
    </style>
</head>
<body>
   <div class="book">
    <!-- 第一页 -->
     <div class="page first">
        <!-- 正面 -->
         <div class="page-item front">
            <img src="./images/cover1.png">
         </div>
         <!-- 反面 -->
         <div class="page-item back">
            <img src="./images/cover2.png">
         </div>
     </div>
    <!-- 第二页 -->
     <div class="page second">
            <img src="./images/cover3.png">
     </div>
   </div>
</body>
</html>
